//
//  LTView.m
//  LTView
//
//  Created by dllo on 15/12/16.
//  Copyright © 2015年 Fengly_nuo. All rights reserved.
//

#import "LTView.h"




@implementation LTView


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
    [_myLabel release];
    [_myTextField release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createLTViewLabel];
        [self createLTViewTextField];
    }
    return self;
}


// label
- (void)createLTViewLabel {
    // 左label 初始化
    self.myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width / 3, self.frame.size.height)];
    _myLabel.textAlignment = NSTextAlignmentLeft;
    _myLabel.font = [UIFont systemFontOfSize:20];
    [self addSubview:_myLabel];
    [_myLabel release];
}


// textField
- (void)createLTViewTextField {
    // 右textField初始化
    self.myTextField = [[UITextField alloc] initWithFrame:CGRectMake(self.frame.size.width / 3, 0, self.frame.size.width / 3 * 2, self.frame.size.height)];
    // 边框
    _myTextField.layer.borderWidth = 2;
    _myTextField.layer.borderColor = [UIColor blackColor].CGColor;
    _myTextField.layer.cornerRadius = 10;
    // 清空
    _myTextField.clearButtonMode = UITextFieldViewModeAlways;
//        _myTextField.clearsContextBeforeDrawing = YES;
//        _myTextField.font = [UIFont systemFontOfSize:20];
    [self addSubview:_myTextField];
    [_myTextField release];
}





@end













